<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="minipost.user.AdministratorBean"%>
<%@ page import="minipost.user.model.Administrator"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
	request.setCharacterEncoding("UTF-8");
	String name = request.getParameter("name");
	String pwd = request.getParameter("password");
	
	Administrator admin = new Administrator(name, pwd);
	AdministratorBean adminBean = new AdministratorBean();
	boolean isValid = adminBean.isValidUser(admin);
   		
	if (isValid == false) {
		response.sendRedirect("login.jsp");
	} else {
		request.getSession().setAttribute("user", admin);
%>

<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>管理</title>
<link rel="stylesheet" type="text/css" href="css/admin.css" />
</head>
<body>
	<div id="head">
		<P>管理</P>
	</div>
	<div id="nav">
		<ul>
			<li><a href="index.jsp">首页</a></li>
            <li><a href="publish.jsp">发表文章</a></li>
            <li><a href="management.jsp">文章管理</a></li>
			<li><a href="xgmm.jsp">修改密码</a></li>
            <li><a href="login.jsp">退出管理</a></li>
		</ul>
	</div>
	<div id="mid">
		<div class="content">管理页面</div>
	</div>
	<div id="foot">Copyright&copy;&nbsp;合肥工业大学网站设计基础</div>
</body>
</html>

<%
	}
%>